﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Giant.Web.Framework;
using Giant.Web.Framework.Mvc;

namespace Giant.Admin.Models.Settings
{
    public partial class AllUserSettingsModel : BaseModel
    {
        public AllUserSettingsModel()
        {
            UserSettings = new UserSettingsModel();
            DateTimeSettings = new DateTimeSettingsModel();
            ExternalAuthenticationSettings = new ExternalAuthenticationSettingsModel();
        }
        public UserSettingsModel UserSettings { get; set; }
        public DateTimeSettingsModel DateTimeSettings { get; set; }
        public ExternalAuthenticationSettingsModel ExternalAuthenticationSettings { get; set; }

        #region Nested classes

        public partial class UserSettingsModel : BaseModel
        {
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.UsernamesEnabled")]
            public bool UsernamesEnabled { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.AllowUsersToChangeUsernames")]
            public bool AllowUsersToChangeUsernames { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.CheckUsernameAvailabilityEnabled")]
            public bool CheckUsernameAvailabilityEnabled { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.UserRegistrationType")]
            public int UserRegistrationType { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.AllowUsersToUploadAvatars")]
            public bool AllowUsersToUploadAvatars { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DefaultAvatarEnabled")]
            public bool DefaultAvatarEnabled { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.ShowUsersJoinDate")]
            public bool ShowUsersJoinDate { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.AllowViewingProfiles")]
            public bool AllowViewingProfiles { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.NotifyNewUserRegistration")]
            public bool NotifyNewUserRegistration { get; set; }
            
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.UserNameFormat")]
            public int UserNameFormat { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.PasswordMinLength")]
            public int PasswordMinLength { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.PasswordRecoveryLinkDaysValid")]
            public int PasswordRecoveryLinkDaysValid { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DefaultPasswordFormat")]
            public int DefaultPasswordFormat { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.NewsletterEnabled")]
            public bool NewsletterEnabled { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.NewsletterTickedByDefault")]
            public bool NewsletterTickedByDefault { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.HideNewsletterBlock")]
            public bool HideNewsletterBlock { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.NewsletterBlockAllowToUnsubscribe")]
            public bool NewsletterBlockAllowToUnsubscribe { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.SiteLastVisitedPage")]
            public bool SiteLastVisitedPage { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.EnteringEmailTwice")]
            public bool EnteringEmailTwice { get; set; }


            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.GenderEnabled")]
            public bool GenderEnabled { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DateOfBirthEnabled")]
            public bool DateOfBirthEnabled { get; set; }
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DateOfBirthRequired")]
            public bool DateOfBirthRequired { get; set; }
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DateOfBirthMinimumAge")]
            [UIHint("Int32Nullable")]
            public int? DateOfBirthMinimumAge { get; set; }
            
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.PhoneEnabled")]
            public bool PhoneEnabled { get; set; }
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.PhoneRequired")]
            public bool PhoneRequired { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.AcceptPrivacyPolicyEnabled")]
            public bool AcceptPrivacyPolicyEnabled { get; set; }
        }

        public partial class DateTimeSettingsModel : BaseModel
        {
            public DateTimeSettingsModel()
            {
                AvailableTimeZones = new List<SelectListItem>();
            }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.AllowUsersToSetTimeZone")]
            public bool AllowUsersToSetTimeZone { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DefaultSiteTimeZone")]
            public string DefaultSiteTimeZoneId { get; set; }

            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.DefaultSiteTimeZone")]
            public IList<SelectListItem> AvailableTimeZones { get; set; }
        }

        public partial class ExternalAuthenticationSettingsModel : BaseModel
        {
            [AppResourceDisplayName("Admin.Configuration.Settings.AllUser.ExternalAuthenticationAutoRegisterEnabled")]
            public bool AutoRegisterEnabled { get; set; }
        }
        #endregion
    }
}